# ***************************************************************************
# File:        CMakeLists.txt
# Description:
# 
# Copyright:   (C) 2001-2012 by ZJ Laczik
# Email:       Laczik@eng.ox.ac.uk
# ****************************************************************************
# Change log:
#    begin      15/2/2012
# ****************************************************************************
project(micromachine)

cmake_minimum_required(VERSION 2.6)

find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})

set (micromachine_VERSION_MAJOR 1)
set (micromachine_VERSION_MINOR 0)

configure_file (
  "${PROJECT_SOURCE_DIR}/src/config.h.in"
  "${PROJECT_BINARY_DIR}/config.h"
  )

# use the following to generate profiling information
# set(CMAKE_CXX_FLAGS "-Wall -g -pg")
# linker flags for DLL generation 
set(CMAKE_EXE_LINKER_FLAGS -rdynamic)

include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})

set(micromachine_SRCS
  src/frontpanel.cpp
  src/steppertiming.cpp
  src/lineeditvalue.cpp
  src/stepper.cpp
  src/batchprocessor.cpp
  src/laser.cpp
  src/positioner.cpp
  src/texttodll.cpp
  src/positiondsp.cpp
  src/micromachine.cpp
  src/main.cpp
  src/hal.cpp
#  src/qextserialport.cpp
#  src/posix_qextserialport.cpp
)

set (micromachine_MOC_H
#  src/qextserialport.h
  src/frontpanel.h
  src/steppertiming.h
  src/batchprocessor.h
  src/laser.h
  src/lineeditvalue.h
  src/positiondsp.h
  src/positioner.h
  src/stepper.h
  src/texttodll.h
  src/micromachine.h
  src/hal.h
)
QT4_WRAP_CPP(micromachine_MOC_OUT ${micromachine_MOC_H})

set(micromachine_UI
  src/frontpanel.ui
  src/steppertiming.ui
)
QT4_WRAP_UI(micromachine_UI_OUT ${micromachine_UI})

SET(micromachine_RC
  src/resources.qrc
)
QT4_ADD_RESOURCES(micromachine_RC_OUT ${micromachine_RC})

add_executable(micromachine ${micromachine_SRCS} ${micromachine_MOC_OUT} ${micromachine_UI_OUT} ${micromachine_RC_OUT})

target_link_libraries(micromachine ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} comedi)
